﻿#ifndef PLOTAREA_H
#define PLOTAREA_H

#include <QWidget>
#include <QThread>
#include "QCustomPlot/qcustomplot.h"
#include "pointstream.h"
class PlotArea : public QCustomPlot
{
    Q_OBJECT
public:
    static const int PERIOD_OF_FRAMES = 50; //100 ms - 20fps//多长时间刷新一次
    static const int MAX_GRAPHNUM = 4; //100 ms - 20fps//多长时间刷新一次
    explicit PlotArea();
    ~PlotArea();

    double getAxisRange() const;
    void setAxisRange(double value);

    void addPointGraphMap(PointStream *points);

public slots:
    void update();
private:
    /*Points 和 graph 的映射*/
    QMap<PointStream *,QCPGraph *> pointGraphMap;
    double axisRange = 4.0;
};
#endif // PLOTAREA_H
